<!DOCTYPE html>
<html>
<head>
	<title>companyModify.html</title>

	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="this is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="../../../plugins/bootstrap/css/bootstrap.min.css"
		type="text/css"></link>
	<link rel="stylesheet" href="../../../plugins/FlatUI/dist/css/flat-ui.css"
		type="text/css"></link>
	<link rel="shortcut icon" href="../../../plugins/FlatUI/dist/img/favicon.ico">
	<link rel="stylesheet" href="../../../css/style.css">
	<script type="text/javascript" src="../../../js/jquery.js"></script>
	<script src="../../../plugins/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../../plugins/FlatUI/dist/js/flat-ui.js"></script>
	<script type="text/javascript" src="../../../plugins/fwb/bootstrap-wysiwyg.js"></script>
	<script src="../../../plugins/fwb/external/jquery.hotkeys.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../../js/productAdd.js"></script>
	<script type="text/javascript" src="../../../plugins/FlatUI/dist/js/application.js"></script>
	<script type="text/javascript" src="../../../js/base.js"></script>
	<script type="text/javascript">
	
	$(function(){
		var companyId = sessionStorage.getItem('companyId');
		
	      $.ajax({
	            url:commonurl+"/selectCompanyById.company",
	            type:"POST",
	            data:{ "companyId":companyId
	            },
	            dataType:"json",
	            success:function(data){
				 	if(data.success){
				 		var obj=data.obj;
						console.log(data.obj);
			  $("#companyId").val(obj.id);
			  $("#companyName").val(obj.companyName);
			  $("#productRate").val(obj.companyRate);
			  $("#content").text(obj.companyIntro);
			  
						/* sessionStorage.setItem("name", name);
						sessionStorage.setItem("id",id); 
						sessionStorage.setItem("userImg",imageUrl); 
						location.href= "main.html"; */
					} 
	            }

	        })
		

			
		    $("#modifyCompanyBtn").click(function(){
		    	
		   
		console.log($("#companyName").val()+"###");
		console.log($("#content").text()+"###");
		        $.ajax({
		            url:commonurl+"/updateCompany.company",
		            type:"POST",
		            data:{ "companyId":$("#companyId").val(),
		            	   "companyName":$("#companyName").val(),
		                   "productRate":$("#productRate").val(),
		                   "content":$("#content").text()

		            },
		            dataType:"json",
		            success:function(data){
		            	alert(data.msg);
		            	 location.href="companyManage.html";
		                //if(!data.success){
		                    //alert(data.msg);
		                //    return;
		               // }
		              //  var obj = data.obj;
		              //  obj.list.forEach(function(value,index){
		                    // value.houseType=value.houseType.split(",");
		                    // value.houseState=value.houseState.split(",");
		                    // value.floorInfo=value.floorInfo.split(",");
		                    // value.updateTime=new Date(value.updateTime) ;
		                    // value.updateTime=value.updateTime.getFullYear() + "年" + (value.updateTime.getMonth() + 1) + "月" + value.updateTime.getDate() + "日 " + value.updateTime.getHours() + "点" + value.updateTime.getMinutes() + "分" + value.updateTime.getSeconds() + "秒";
		              //  })
		                // var datas={
		                //     sources:obj.list,
		                //     total:obj.total,
		                //     commonurlimg:commonurlimg
		                // };
		                // $(".houseList").html(template("detailList",datas));
		                // myPaginatorFun("myPages", obj.pageNo, obj.pages);
		            }

		        })
		    });
	})
	
	
	
	
	</script>
</head>

<body style="padding: 5px 10px">

	<div class="panel panel-primary">
	  <div class="panel-heading">
	    <h3 class="panel-title">企业修改</h3>
	  </div>
	  <div class="panel-body">
	  		
	  		<form class="form-horizontal" role="form" action="productManage.html">
	  		
	  		<div class="form-group">
              <label for="companyId" class="col-lg-2 control-label">企业编号</label>
              <div class="col-lg-10">
                <input type="text" class="form-control" id="companyId" value="111" readonly="readonly">
              </div>
            </div>
	  		
            <div class="form-group">
              <label for="companyName" class="col-lg-2 control-label">企业名称</label>
              <div class="col-lg-10">
                <input type="text" class="form-control" id="companyName" placeholder="产品名称">
              </div>
            </div>
            
            <div class="form-group">
            	<label for="productRate" class="col-lg-2 control-label">融资佣金</label>
            	<div class="col-lg-10">
			        <div class="input-group col-lg-3" style="float: left;">
			            <input id="productRate" type="text" class="form-control" placeholder="佣金数">
			            <span class="input-group-addon">%</span>
			        </div>
			    </div>
          	</div>
            
            <div class="form-group">
              <label for="content" class="col-lg-2 control-label">内容</label>
              <div class="col-lg-10">
              	
<!-- 			asdjalkj dlkajsdkl asjdlkaj sdkl asd -->
			<div class="btn-toolbar" data-role="editor-toolbar"	data-target="#content">
				<div class="btn-group">
					<a class="btn" data-edit="indent" title="Indent (Tab)">
						Tab缩进
					</a>
				</div>
				<div class="btn-group">
					<a class="btn" data-edit="justifyleft"
						title="Align Left (Ctrl/Cmd+L)">
						左对齐
					</a> 
					<a class="btn" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)">
						居中
					</a> 
					<a class="btn" data-edit="justifyright"
						title="Align Right (Ctrl/Cmd+R)">
						右对齐
					</a> 
					<a class="btn" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)">
						自动调整
					</a>
				</div>
		
		 		<div class="btn-group">
					<a class="btn" data-edit="undo" title="Undo (Ctrl/Cmd+Z)">
						撤销
					</a> 
					<a class="btn" data-edit="redo" title="Redo (Ctrl/Cmd+Y)">
						恢复
					</a>
				</div>
				
			</div>
<!--               	asdalksdjklasj -->
              	
            <div id="content" style="overflow:scroll; max-height:300px;border: 1px solid;height: 200px;"></div>
         </div>
     </div>
            
            
            
            <div class="form-group">
              <div class="col-lg-offset-2 col-lg-10">
                <button id="modifyCompanyBtn" type="button" class="btn btn-lg btn-info" style="padding: 15px 60px;border-radius: 0px;">修改</button>
              </div>
            </div>
          </form>
	  		
	  		
	  		
	  </div>
	</div>
	
</body>
</html>
